import complex_query from '@dfeidao/atom-nodejs/db/complex-query';
import { IncomingHttpHeaders } from 'http';
import { systemid } from '../../atom/config';

interface Message {
	staff_no: string;

}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const c = complex_query(action_id, session_id, systemid);
	const res = await c
		.add_field('department_staff', 'staff_no', 'staff_no')
		.add_field('department_staff', 'staff_name', 'staff_name')
		.add_field('department_staff', 'deptname', 'deptname')
		.where_like('department_staff', 'staff_no', '%' + message.staff_no + '%')
		.exec();
	
	return res;
}
